Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pure-color

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-color

Pure functions for color conversion and parsing

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is pure-color?

The pure-color npm package is a lightweight library for color manipulation and conversion. It provides a set of functions to work with colors in various formats, such as RGB, HSL, and HEX, and allows for operations like color blending, lightening, darkening, and more.

What are pure-color's main functionalities?

Color Conversion

Convert colors between different formats. In this example, HSL is converted to RGB.

const color = require('pure-color');
const rgb = color.convert.hsl.rgb([0.5, 0.5, 0.5]);
console.log(rgb); // [63.75, 191.25, 191.25]

Color Blending

Blend two colors together. This example blends red and blue in equal parts to produce a purple color.

const color = require('pure-color');
const blendedColor = color.blend.rgb([255, 0, 0], [0, 0, 255], 0.5);
console.log(blendedColor); // [127.5, 0, 127.5]

Color Lightening

Lighten a color by a given percentage. This example lightens a gray color by 20%.

const color = require('pure-color');
const lightenedColor = color.manipulate.lighten([100, 100, 100], 0.2);
console.log(lightenedColor); // [120, 120, 120]

Color Darkening

Darken a color by a given percentage. This example darkens a gray color by 20%.

const color = require('pure-color');
const darkenedColor = color.manipulate.darken([100, 100, 100], 0.2);
console.log(darkenedColor); // [80, 80, 80]

Other packages similar to pure-color

Keywords

FAQs

Package last updated on 20 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc